/* 小程序登录
POST
/login/wxMin
 */
import type { LoginResult } from '@/types/member'
import { http } from '@/utils/http'
export type loginParams = {
  code: string // 通过 wx.login() 获取
  encryptedData: string //通过 getphonenumber 事件回调中获取
  iv: string //通过 getphonenumber 事件回调中获取
}
export const postLoginWxMin = (data: loginParams) => {
  return http<LoginResult>({
    method: 'POST',
    url: '/login/wxMin',
    data,
  })
}

// 小程序模拟登录
// /login/wxMin/simple
export const postLoginWxMinSimpleApi = (phoneNumber: string) => {
  return http<LoginResult>({
    method: 'POST',
    url: '/login/wxMin/simple',
    data: {
      phoneNumber,
    },
  })
}
